package com.yidu.t299.dao.xp;

import com.yidu.t299.domain.xp.School;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

/*
使用Mybatis逆向生成自动生成 后续自己更改
 */
@Mapper
public interface ClassbMapper {

    /**
     * 根据班级编号查询指定的信息
     * @param classId 班级编号
     * @return 班级对象
     */
    @Select({
        "select ",
        " *",
        " from class",
        " where class_id = #{classId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="class_id", property="classId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="class_name", property="className", jdbcType=JdbcType.VARCHAR),
        @Result(column="class_type", property="classType", jdbcType=JdbcType.VARCHAR),
        @Result(column="startClass_time", property="startclassTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="startClass_num", property="startclassNum", jdbcType=JdbcType.INTEGER),
        @Result(column="classroom_id", property="classroomId", jdbcType=JdbcType.INTEGER),
        @Result(column="school_id", property="schoolId", jdbcType=JdbcType.INTEGER),
        @Result(column="record_id", property="recordId", jdbcType=JdbcType.INTEGER),
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.INTEGER),
       @Result(column="class_id", property="school", javaType = School.class
               ,one = @One(select = "com.yidu.t299.dao.xp.SchoolbMapper.selectByPrimaryKey"))

    })
    Class selectByPrimaryKey(Integer classId);

}